import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Mine from '../views/Mine.vue'
import PersonalInformation from '../components/PersonalInformation.vue'
// import Trolley from '../views/Trolley.vue'

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: { navShow: true, title: '一级页面' }
  },
  {
    path: '/Address',
    name: 'Address',
    component: ()=>import('../views/Address.vue'),
    meta: { navShow: true, cname: '二级页面' }
  },
	{
    path: '/shoppingcar',
    name: 'ShoppingCar',
    component: ()=>import('../views/ShoppingCar.vue'),
    meta: { navShow: true, cname: '二级页面' }
  },
  {
    path: '/NewAddress',
    name: 'NewAddress',
    component: ()=>import('../views/NewAddress.vue'),
    meta: { navShow: false, cname: '二级页面' }
  },
  {
    path: '/Login',
    name: 'Login',
    component: ()=>import('../views/Login.vue'),
    meta: { navShow: false, title: '二级页面' }
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import(/* webpackChunkName: "about" */ '../views/Detail.vue'),
    meta: { navShow: false, cname: '二级页面' }
  },
  {
    path: '/more',
    name: 'more',
    component: () => import(/* webpackChunkName: "about" */ '../views/more.vue'),
    meta: { navShow: false, cname: '二级页面' }
  },
  {
    path: '/trolley',
    name: 'Trolley',
    component: () => import(/* webpackChunkName: "about" */ '../views/Trolley.vue'),
    meta: { navShow: true, cname: '一级页面' }
  },
  {
    path:'/DetailsPage/:id',
    name:'DetailsPage',
    component: () => import('../components/DetailsPage.vue'),
    meta: {navShow:false,cname:'二级页面'}
  },
  {
    path: '/mine',
    name: 'Mine',
    component: Mine,
    meta: { navShow: true, cname: '一级页面' }
    // component: () => import(/* webpackChunkName: "about" */ '../views/Mine.vue')
  },
  {
    path: '/PersonalInformation',
    name: 'PersonalInformation',
    component: PersonalInformation,
    meta: { navShow: false, cname: '二级页面' },
  },
  {
    path: '/VipCode',
    name: 'VipCode',
    component: () => import('../components/VipCode.vue'),
    meta: { navShow: false, cname: '二级页面' },
  },
  {
    path: '/Order',
    name: 'Order',
    component: () => import('../components/Order.vue'),
    meta: {navShow:false,cname:'二级页面'},
    children: [
      {
        path: '/Order/',
        name: 'Detailed',
        component: () => import('../components/order-child/Detailed.vue'),
      },
      {
        path: '/Order/Without',
        name: 'Without',
        component: () => import('../components/order-child/Without.vue'),
      }
    ]
  },
  {
    path:'/class',
    name:'Class',
    component: () => import('../views/Class.vue'),
    meta: {navShow:true,cname:'一级页面'}
  }
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});

export default router
